<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>出发吧</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<jsp:include page="/common/include_js.jsp" />
<script type="text/javascript" src="<%=request.getContextPath() %>/js/My97DatePicker/WdatePicker.js"></script>
<script type="text/javascript" src="<%=request.getContextPath() %>/js/bsn.AutoSuggest_2.1.3.js"></script>
<link rel="stylesheet" type="text/css" media="screen" href="<%=request.getContextPath() %>/front/css/css.css" />
<link rel="stylesheet" type="text/css" media="screen" href="<%=request.getContextPath() %>/css/autosuggest_inquisitor.css" />
</head>
<body>
<div id="wrap">
  <jsp:include page="include/top.jsp">
  	<jsp:param name="t" value="4" />
  </jsp:include>

  <div id="main">
  	<div id="flight_left">
      <div class="flight">
        <div class="hotelBox flightSearch china">
          <div class="search_title">
            <h2 id="search_internal" class="Default"><span>国内及国外酒店搜索</span></h2>
          </div>
          <div class="boxpad">
            <form action="<%=request.getContextPath() %>/front/order!hotelSearch.action" method="post" id="subForm">
          	<input type="hidden" name="toCity" id="_toCity" value="" />
            <table width="100%" border="0" cellspacing="0" cellpadding="0" class="mr">
              <tr>
                <td width="8%"><b>入住城市</b></td>
                <td width="0"><div class="tlbox qcity">
                    <div class="boxWrapper">
                      <div id="mainXI0" class="boxContainer">
                        <div class="sicon"></div>
                        <div style="clear:both"></div>
                      </div>
                    </div>
                    <input type="text" id="toCity" class="hotelwd flightinput">
                    <div class="popContainer"></div>
                  </div></td>
                <td width="8%"><b>酒店信息</b></td>
                <td width="0"><div class="tlbox tlbox2 qcity">
                    <div class="boxWrapper">
                      <div id="mainXI0" class="boxContainer">
                        <div class="sicon"></div>
                        <div style="clear:both"></div>
                      </div>
                    </div>
                    <input type="text" name="key" class="hoteldt flightinput">
                    <div class="popContainer"></div>
                  </div></td>
              </tr>
              <%
              	java.text.SimpleDateFormat sdf = new java.text.SimpleDateFormat("yyyy-MM-dd");
              	java.util.Date _today = new java.util.Date();
              	String day1 = sdf.format(new java.util.Date(_today.getTime())); //+1000*60*60*24
              	String day2 = sdf.format(new java.util.Date(_today.getTime()+1000*60*60*24));
              %>
              <tr>
                <td><b>入住日期</b></td>
                <td><div class="tlbox qcity">
                    <div class="boxWrapper">
                      <div id="mainXI0" class="boxContainer">
                        <div class="sicon"></div>
                        <div style="clear:both"></div>
                      </div>
                    </div>
                    <input type="text" id="fromDate" name="fromDate" class="hotelwd flightinput" onclick="WdatePicker({minDate:'<%=day1 %>',isShowClear:false,readOnly:true});" value="<%=day1 %>" />
                    <div class="popContainer"></div>
                  </div></td>
                <td><b>离开日期</b></td>
                <td><div class="tlbox tlbox2 qcity">
                    <div class="boxWrapper">
                      <div id="mainXI0" class="boxContainer">
                        <div class="sicon"></div>
                        <div style="clear:both"></div>
                      </div>
                    </div>
                    <input type="text" id="toDate" name="toDate" class="hoteldt flightinput" onclick="WdatePicker({minDate:'#F{$dp.$D(\'fromDate\')}',isShowClear:false,readOnly:true});" value="<%=day2 %>" />
                    <div class="popContainer"></div>
                  </div></td>
                <td><span class="startSth">
                  <input title="搜索" type="button" class="flightsearch" onclick="javascript:subForm();" value="搜索" />
                  </span></td>
              </tr>
            </table>
            </form>
          </div>
        </div>
      </div>
    </div>
    
    <jsp:include page="include/flight-right.jsp" />
  </div>
  
  <jsp:include page="include/bottom.jsp" />
</div>

<script type="text/javascript">
var subForm=function(){
	if($('_toCity').value==''){
		alert('请填写完整 入住城市');
		return;
	}
	if($('fromDate').value==''){
		alert('请填写 入住日期');
		return;
	}
	if($('toDate').value==''){
		alert('请填写 离开日期');
		return;
	}
	
	document.getElementById('subForm').submit();
};

var options = {
	script:'<%=request.getContextPath() %>/json/query!hotelCity.action?',
	varname:'k',
	meth:'post',
	json:true,
	shownoresults:false,
	maxresults:10,
	clickOneResult:1,
	callback: function (obj) { document.getElementById('_toCity').value = obj.id; }
};
new bsn.AutoSuggest('toCity', options);

</script>
</body>
</html>